#include <iostream>
#include <vector>

using namespace std;

template <typename TypeA>
const TypeA* find_num(const vector<TypeA>& vec, const TypeA &size)
{
    for (int i = 0; i < (int)vec.size(); i++)
        if (vec[i] == size)
            return &vec[i];
    return 0;
}

int main()
{
    vector<int> vec{2154, 4524, 6545, 7845};
    vector<double> dssw{421.21, 45157.42, 54521.14, 100.01};

    cout << *find_num(vec, 2154) << endl;
    cout << *find_num(dssw, 100.01) << endl;
    cout << *(vec.end() - 1);
}